package com.shop.cereshop.app.tencent.im.model.transfer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @description: 领取/退款转账请求参数传输对象
 * @author zdd
 * @date 2025/9/3 14:36
 * @version 1.0
 */
@ApiModel("领取/退款转账请求参数传输对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TransferOrderDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("转账单号")
    private String transferId;

    @ApiModelProperty("接收者ID")
    private String receiverId;

    @ApiModelProperty("接收者名称")
    private String receiverName;

    @ApiModelProperty("领取时的IP地址")
    private String receiverIp;

    @ApiModelProperty("领取设备信息（User-Agent或设备型号）")
    private String receiveDevice;

    /**
     * 转换为领取记录
     *
     * @return 领取记录
     */
    public TransferReceiveRecord coverToTransferReceiveRecord() {
        TransferReceiveRecord receiveRecord = new TransferReceiveRecord();
        receiveRecord.setTransferId(this.getTransferId());
        receiveRecord.setReceiverId(this.getReceiverId());
//        receiveRecord.setAmount(receiveAmount);
        receiveRecord.setReceiveIp(this.getReceiverIp());
        receiveRecord.setReceiveDevice(this.getReceiveDevice());
        receiveRecord.setReceiveTime(LocalDateTime.now());
        return receiveRecord;
    }

}
